/**
 * 项目名称:
 *
 * @Author: 夏国倩
 * @Date: 2023/9/22 11:33
 * @Copyright
 */
package Map;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

public class MapTest5 {
    public static void main(String[] args) {
        System.out.println("老师       课程");
        Map<String, String> map = new LinkedHashMap<>();
        map.put("Tom", "  CoreJava");
        map.put("John", " Oracle");
        map.put("Susan", "Oracle");
        map.put("Jerry", "JDBC");
        map.put("Jim", "  Unix");
        map.put("Kevin", "JSP");
        map.put("Lucy", " JSP");
        map.put("Allen", "JDBC");

        Set<String> keySet = map.keySet();
        for (String key : keySet) {
            String value = map.get(key);
            System.out.println(key + "      " + value);
        }
        System.out.println("---------------------------");
        map.put("Lucy", " CoreJava");
        Set<String> keySet1 = map.keySet();
        for (String key : keySet) {
            String value = map.get(key);
            System.out.println(key + "      " + value);
        }
        System.out.println("---------------------------");
        map.forEach((k,v)->{
            if (v.equals("JSP")){
                System.out.println(k+"     "+v);
            }
        });
    }
}
